package MineGod;

import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;

public class ParticleBlockBreak extends Particle {

	public double maxSize;
	public double size;
	public double initialLife;
	
	public double iR = 1.0; //initial red value
	public double iG = 0.0;
	public double iB = 0.0;
	public double fR = 1.0; //final red value;
	public double fG = 1.0;
	public double fB = 0.0;
	
	public double red = 1;
	public double green = 1;
	public double blue = 1;
	private Texture tex;
	
	
	
	public ParticleBlockBreak(double life, double xPos, double yPos, double xSpeed, double ySpeed, Texture t){
		super(life, xPos, yPos, xSpeed, ySpeed);
		initialLife = life;
		maxSize = 5;
		size = 3;
		tex = t;
	}
	
	public void update(int delta){
		super.update(delta);
		this.ySpeed += .0005*delta;
	}
	
	public void render(){
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
		tex.bind();
		double renderX = initialX-MineGod.player.xPos;
		GL11.glBegin(GL11.GL_QUADS);
			GL11.glNormal3d(0, 0, 1);
			GL11.glColor3d(red, green, blue);
			GL11.glVertex3d(renderX+xPos, yPos, -15);
			GL11.glColor3d(red, green, blue);
			GL11.glVertex3d((renderX+xPos + size), yPos, -15);
			GL11.glColor3d(red, green, blue);
			GL11.glVertex3d((renderX+xPos + size), (yPos+size), -15);
			GL11.glColor3d(red, green, blue);
			GL11.glVertex3d(renderX + xPos, (yPos+size), -15);
		GL11.glEnd();
	}
	
	
	
}
